package com.wuyou.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000121660824";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCHY+gtE7mO5HyGm/A6KS/yPFwq+XlR7eKHL+0bINAn+QsPKalsT2XQMzTPC8xwBVy263kUAx1RqHzf4chx6jH8Ze1EQI0PcffBCHYKpKvWdDak4rYnosTWBcMjeV0p+ebtlbyCyN/ny9/lko2hJMVia3MFdJ40QWYtQD48kox6TSj5j8SaIcqVY0FVu5/zIb4z3byPxgoZkAdqHtNczg/AnQccHK0/BP6ssb1804hfxbotCe0UYe1ZLdBzlmms26lsBeoMstPCrJRToUcSXOtyB1L1xU9Fa/DR0CzSLisdL8k6Yw+pClHrHFPGQ7Z6edK14IHJcnpfCrJ6kSE5zxfVAgMBAAECggEAHlS5fO/AUEzLwPRKWx1DCoePNmlxTnN2nkaUXdF6EJpwadMxi3w2GPB/0iqYgDgTTz9tfpg8B0ExyI4yc6K91AeZogK8F0u2713P5A6EGKUsYMARgsuqQTBFSTs1LeQ4Yd17v+j0kF9SJ4IvjHxKZAQiXoSDtL06AMU1rChApF00B8we+Iw6pB6eTitL/5zJrNBC5zq9gJJ3/NljsH3/uyLPWYsTYMRg5cVBcv1IXr1xJbe0AVH4kX5oEh+aB96NnGMURfIGy6ZTNRHBLTYRSEAjN4CGTFojAk7wI/iUXHrb11Q0fkXo8wvjnDOy/n72H+2NLjZ8Xpw9uCPVYpG9QQKBgQDgHn1R0g34ZTYtU4XOSQJgPXdZnyijUiRgNydc6Z4+zHMW8hMrlE1eaJdKmbyBVldTBgLytpRvRriMtgp1dqgcXcP3bHqzOT5JaT7I9x3tL4GfI7yjcGdcY9vyf1xHktCMaRO2A5MLOmSp3FEVExv/XSdFfXbztczBq8serGn4uQKBgQCapkWynyahrJ1TZLKONHvBz08Pxw2KAyhorzGe8Gt6upRlVIEsXwNXIrFSRuH2ZvaDRkIgduBlN52D5ZYQd8ByDEIBiJIEDTHpxV473dBMgizJV9g8krepcy+SvqItYd0WWY55BfyAzmoPh/e8ZExpznWQNFg+AJZWR8oQQBAR/QKBgFpIzhFE/m2/UBjoWbHlRXjBqi/HZxaMA61i6o+KaT5BHGf08vYOUzCiD7h0wDSWNK10cYGXPaqqIbRFrWbuewCaYVRuNeu3NrlaFXnd2wduqNgUDG0G3gyhCbzhw6ntoee+eLtNK1JNnrmy0FMeFJxFyYk75sx8w1SNwVDFAhe5AoGAToz2CexcqvIKVzlmmGSAF8k81z672cYQ2FtkUN69OPFcPrvVgLwh7jho6OmoDIfv3m3pWKQJBmBhWYVb27F3xnYDcNP1lqk9GQhu/OmFy9ay+PHtm5bKQv+Gwnqh1XtH2PpUK5Sm1KYDqS/e3Yn0Zim//ScZSyTxN5HvSKHBh+ECgYASj1pB4E9lEHLapcE2/5TT3FuUWv2iRQO/Tlo7HStqeh8pT5+9FzmzzGx51UMoap0CxOMFXtxTBUDqDbT/jUutdCY/W5wGzxkA4UdGX59YL6IEvByDslbYuCgtmd03kAa9mlNHmsomeAve2PkseStrf6fp8zMTmL9yvIh1BkqQAQ==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqvm8fT+DK+wWAFaFpye1BBGUGrxZ6kqd3LUf1b6xHpjqbFwlJeh1p5TFVxeejxVaUkrVGh/D/JOwIXDMFd3HXU+puD0gG8jSRMqdFnGIx7zeUetCTNcI/jaxdhhvQZAGWePmrlAcPITJmEvwz8LJKptbI22Nrv6TKJn0PpSz90qO0OBaCwW6vofP5Gsi/fdCCJa0zlazD9TobU/DoCL8rYLdN6Hn3NtIfbffm0dO4znwoCZ8tCDx1HoD7M0YMw783MdEVTsmjRvf8sZTQ13sc0Hg4c8ImuWIx3+SXNs5p3IdrIL4rnDQAmfo69kGFLmFK8j4nu1X85taKoaU6igHYwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "https://hc59254493.zicp.fun/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "https://hc59254493.zicp.fun/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

